Skip to content

feat(orchestrator): pass model options through MCP thread targets#3872

Open
PixPMusic wants to merge 2 commits into
pingdotgg:t3code/codex-turn-mappingfrom
PixPMusic:pixpmusic/fix-delegate-model-options
Open

feat(orchestrator): pass model options through MCP thread targets#3872
PixPMusic wants to merge 2 commits into
pingdotgg:t3code/codex-turn-mappingfrom
PixPMusic:pixpmusic/fix-delegate-model-options

Conversation

@PixPMusic

@PixPMusic PixPMusic commented Jul 10, 2026

Copy link
Copy Markdown

The thread orchestrator had no way to pass model options (reasoning effort, variant settings, ...) down to a child thread: delegate_task / create_threads / t3_thread_start targets only carried providerInstanceId/driverKind/model, and resolveTarget dropped options entirely. Reported by joaquin on Discord while testing the orchestrator v2 branch.

  • target.options now accepts the canonical [{ id, value }] array or the shorthand { reasoning: "low" } record on every MCP target.
  • Requested options are validated against the model's advertised option descriptors; invalid ids/values fail with invalid_request listing the valid choices.
  • Valid options flow into the child thread's model selection (previously any override produced a bare { instanceId, model }).
  • orchestrator_capabilities now advertises per-model option descriptors so agents can discover valid option ids and values before delegating.

Covered by contract decode tests (both option shapes) and the orchestrator MCP integration test (options reach the child's model selection; invalid options are rejected before any thread is created; capabilities advertise descriptors).


Note

Medium Risk
Touches orchestration target resolution and child modelSelection behavior on a public MCP surface; risk is mitigated by strict validation and integration/contract tests, with no auth or persistence migration changes.

Overview
MCP orchestration targets (delegate_task, create_threads, t3_thread_start) can now carry model options (e.g. reasoning effort), which previously stopped at provider/model and never reached child threads.

Contracts: OrchestratorMcpTarget gains optional options, decoded as either [{ id, value }] or a shorthand { id: value } record. Unlike persistence schemas, invalid value types fail decode instead of being dropped. Capability responses expose per-model option descriptors so agents can discover valid ids before delegating.

Server: resolveTarget validates options (duplicate ids, unknown ids, boolean/select typing) against the resolved model’s descriptors and returns invalid_request before creating a child. Valid options are written into the child’s modelSelection; reusing the parent’s selection object only happens when provider, model, and options are all unchanged.

Tool descriptions mention target.options and point agents at orchestrator_capabilities.

Reviewed by Cursor Bugbot for commit 45b3605. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Pass model options through MCP orchestrator thread targets with validation

  • Adds an optional options field to OrchestratorMcpTarget in orchestratorMcp.ts, accepting either a canonical ProviderOptionSelection array or a shorthand { id: value } record form.
  • Validates requested options in the make generator of OrchestratorMcpService.ts against provider-advertised descriptors, rejecting duplicates, unknown ids, type mismatches, and invalid select values with an invalid_request error.
  • Includes validated options in the modelSelection recorded for child threads; inheritance from parent thread now only applies when instanceId and model match and no options were requested.
  • Surfaces per-model optionDescriptors in orchestrator_capabilities responses so clients can discover valid option ids and values.

Macroscope summarized 45b3605.

Delegated tasks and MCP-created threads previously had no way to set the
child's model options (reasoning effort, fast mode, ...): target only
carried providerInstanceId/driverKind/model and resolveTarget dropped
options entirely. Accept canonical and shorthand option selections on
every MCP target, validate them against the model's advertised option
descriptors, carry them into the child's model selection, and advertise
per-model option descriptors in orchestrator_capabilities so agents can
discover valid ids and values.
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 62148824-e64c-4fc0-8229-fc452931267e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5f5abdf. Configure here.

Comment thread apps/server/src/mcp/OrchestratorMcpService.ts
Comment thread apps/server/src/mcp/OrchestratorMcpService.ts
@macroscopeapp

macroscopeapp Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

1 blocking correctness issue found. This PR introduces a new feature enabling model options (like reasoning effort) to be passed to child threads through MCP targets. New runtime behavior propagation to previously unaffected code paths warrants human review to verify the design and downstream effects.

You can customize Macroscope's approvability policy. Learn more.

Review follow-ups: the shorthand record form previously reused the
legacy-tolerant persistence schema, which silently dropped values that
are not strings or booleans instead of failing the request; decode it
strictly instead. Duplicate option ids now fail validation regardless
of descriptor availability, since downstream consumers disagree on
whether the first or last value wins.
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant